<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <script>
window.onload=function(){   	//网页加载完毕后调用
        alert(location.href);   	//弹出当前页面的URL链接
        alert(location.port);   	//弹出当前页面访问的端口
    }

 </script>
 </head>
 <body>
 </body>
</html>

